@import "~colors.scss";

$taskElementBorder: 1px solid $second-color;
$today-color: yellowgreen;
$item-size: 50px;
$control-panel-color: #2b0296;

.task-list2 {
    font-size: 24px;
    margin-top: 7px;
    display: flex;
    color: lighten($second-color, 20);
    .task-date {
        background-color: #666;
        border-left: $taskElementBorder;
        border-top: $taskElementBorder;
        .td-item {
            height: $item-size;
            background-color: #585858;
            line-height: $item-size;
            text-align: center;
            border-bottom: $taskElementBorder;
            cursor: default;
            width: $item-size;
            overflow: hidden;
            span {
                display: block;
                width: 100%;
                height: 100%;
                background-repeat: no-repeat;
                background-size: 30px;
                background-position: 10px 10px;
                transform: scale(1.1);
            }
            span.done {
                background-color: $done-color;
                background-image: url("~images/circle.svg");
            }
            span.fail {
                background-color: $fail-color;
                background-image: url("~images/cross2.svg");
            }
            span.unknown {
                background-color: $unknown-color;
            }
            span.unknown:hover {
                background-color: saturate(lighten($unknown-color, 20), 40);
            }
        }
    }
    .task-date.today {
        border-left: 5px solid $today-color;
        border-right: 5px solid $today-color;
        .td-date {
            background-color: $today-color;
            border-color: $today-color;
            color: $color-background;
        }
    }
    .task-date.today + .task-date{
        border-left: none;
    }
    .task-date:hover:not(.today) .td-date {
        background-color: #656565;
    }
    .task-date:last-child {
        border-right: $taskElementBorder;
    }
}
.task-labels {
    .label-container {
        display: flex;
    }
    .tl-label {
        cursor: pointer;
        display: flex;
        align-items: center;
        background-color: #777;
        white-space: nowrap;
        padding-left: 5px;
        border-bottom: $taskElementBorder;
        height: $item-size;
        width: 200px;
        position: relative;
    }
    .tl-label:first-child {
        cursor: auto;
    }
    .tl-label:hover {
        color: $new-color-1;
    }
    .tl-label::after {
        content: '';
        position: absolute;
        right: 0; top: 0;
        height: 100%;
        width: 60px;
        background: linear-gradient(to right, transparent, #777 80%);
    }

    .tl-label > .label-container {
        display: flex;
    }
    .label-container {
        > .task {
            width: 200px;
            overflow: hidden;
            display: flex;
            align-items: center;
        }
        > .popup {
            z-index: 3;
            height: $item-size;
            width: ($item-size + 1) * 29 + 8px;
            overflow: hidden;
            background-color: rgba(100, 200, 100, 0.6);
            position: relative;
        }
        > .popup::before {
            content: "";
            z-index: -1;
            position: fixed;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
        }
    }

    .label-container .popup .fake-items {
        display: flex;
        position: absolute;
        top: 0;
        left: 0;
        transition: left, .5s;
        .fake-item {
            width: $item-size;
            height: $item-size;
            border-left: $taskElementBorder;
            overflow: hidden;
            span {
                display: block;
                width: 100%;
                height: 100%;
                background-repeat: no-repeat;
                background-size: 30px;
                background-position: 10px 10px;
                transform: scale(1.1);
            }
            span.done {
                background-color: $done-color;
                background-image: url("~images/circle.svg");
            }
            span.fail {
                background-color: $fail-color;
                background-image: url("~images/cross2.svg");
            }
            span.unknown {
                background-color: $unknown-color;
            }
        }
        .fake-item.today {
            border-left: 5px solid $today-color;
            border-right: 5px solid $today-color;
            + .fake-item {
                border-left: none;
            }
        }

        &.offset {
            left: $item-size + 1px;
            transition: left, .5s;
        }
    }
    .label-container .popup .control-panel {
        border-left: $taskElementBorder;
        height: 50px;
        width: 200px;
        display: flex;
        align-items: center;
        background-color: $control-panel-color;
        span.edit {
            display: block;
            width: $item-size;
            height: 100%;
            background-repeat: no-repeat;
            background-size: 30px;
            background-image: url("~images/edit.svg");
            background-position: 10px 10px;
        }
    }
}